﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Store.Master" 
    Inherits="System.Web.Mvc.ViewPage<YourStore.ViewModels.StoreManagerViewModel>" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Edit - <%: Model.Product.Name %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Edit Product</h2>

   <script src="../../Content/ckeditor/ckeditor.js" type="text/javascript"></script>
    <script src="../../Content/ckeditor/_samples/sample.js" type="text/javascript"></script>
    <link href="../../Content/ckeditor/_samples/sample.css" rel="stylesheet" type="text/css" />   

    <% Html.EnableClientValidation(); %>

     <% using (Html.BeginForm("Edit", "StoreManager", FormMethod.Post, new { enctype = "multipart/form-data" }))
        {%>
      <%: Html.ValidationSummary(true)%>
      <%= Html.Hidden("ProductId", Model.Product.ProductId)%>
      <%= Html.Hidden("Deleted", Model.Product.Deleted)%>
      <%= Html.Hidden("CreatedOn", Model.Product.CreatedOn)%>
      <%= Html.Hidden("UpdatedOn", Model.Product.UpdatedOn)%>
      <div class="create">
        <dl>
        <dt>Category:</dt>
        
        <dd><%= Html.DropDownList("CategoryId", null, new { style = "width:250px;" })%> </dd> 
        
        <dt> Product Name:</dt>
        <dd> <%= Html.TextBox("Name", Model.Product.Name, new { style = "width:250px;" })%> </dd>
        <dt>Product Price:</dt>
        <dd> <%= Html.TextBox("Price", Model.Product.Price, new { style = "width:250px;" })%></dd>
        <dt>Published:</dt>
        <dd> <%= Html.CheckBox("Published", Model.Product.Published)%> </dd>
        <dt>Product Image:</dt>
        <dd><input type="file" id="Image"  value="Browse"  name="Image" /></dd>
        <dt>Display On Home:</dt>
        <dd> <%= Html.CheckBox("DisplayOnHome", Model.Product.DisplayOnHome)%> </dd>
        <dt>Related Product:</dt>
        <dd> <%= Html.TextBox("RelatedProduct", Model.Product.RelatedProduct, new { style = "width:250px;" })%></dd>
        
        <dt>Product Description:</dt>
        <dd>&nbsp;</dd>
        </dl>   
         
       
        <div style=" float:right"> <%= Html.TextArea("Description", Model.Product.Description, new { @class = "ckeditor", cols = "80", rows = "10" })%>
        
        <p><input type="submit" value="Save"  class="sub"/></p>
        <p><%: Html.ActionLink("Back to List", "Index")%></p>
        </div>
        </div> 
        <%} %>

   
</asp:Content>